<?php
$user="junemann_nl";
$password="";
$database="junemann_nl";

$con = mysql_connect("localhost",$user,$password);
if(!$con)
{
	die("Unable to connect to server");
}

mysql_select_db($database, $con);

echo "<?xml version='1.0' encoding='UTF-8'?><zones>";

$resultZones = mysql_query("SELECT * FROM null_sk_zones");

while($zoneRow = mysql_fetch_array($resultZones))
{
  echo "<zone id='". $zoneRow['ID'] . "' name='" . $zoneRow['Name'] . "'>";
  
  $resultBosses = mysql_query("SELECT * FROM null_sk_bosses WHERE ZoneID = " . $zoneRow['ID']);
  while($bossRow = mysql_fetch_array($resultBosses))
  {
	echo "\n";  
   echo '<boss id="'. $bossRow['ID'] . '" name="' . $bossRow['Name'] . '">';
   
   $resultItems = mysql_query("SELECT * FROM null_sk_items WHERE BossID = " . $bossRow['ID']);
   while($itemRow = mysql_fetch_array($resultItems))
   {   
      echo '<item id="'. $itemRow['ID'] .'" name="' . $itemRow['Name'] . '" IsHeroicDrop="' . $itemRow['IsHeroicDrop']  .'" />';
      echo "\n";  
   }
   echo "</boss>";  
  }  
  echo "\n";  
  echo "</zone>";  
}

echo "</zones>";

mysql_close($con);
?>